<template>
  <div class="E-box-containers">
    <p class="title">
      {{title}}
      <slot name="box-right" />
    </p>
    <div
      class="body"
      v-loading="loading"
      element-loading-text="拼命加载中..."
      element-loading-spinner="el-icon-loading"
    >
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '标题：XXX'
    },
    loading: {
      type: Boolean,
      default: false
    }
  }
};
</script>

<style lang="scss">
.E-box-containers {
  cursor: default;
  & > p.title {
    margin: 0;
    line-height: 35px;
    font-size: 16px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    font-weight: 500;
    // color: #555;
    & > .box-right {
      float: right;
      font-size: 14px;
      cursor: pointer;
      &:hover {
        color: #000;
      }
    }
  }
  & > .body {
    padding-bottom: 30px;
    min-height: 180px;
  }
}
</style>
